<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>05_js流程控制</title>
</head>
<body>
<script>
    //顺序结果
    console.log('1');
    console.log('2');

    var user='rose';
    if(!user){
        alert("请输入用户名");

    }else{
        alert("欢迎"+user);
    }

    let a = 0;
    switch (a){
        case 1:
            console.log('男');
            break;
        case 0:
            console.log('女');
            break;
        default:
            console.log('未知');
    }
    let names = ['张三','李四','王五'];
    for (var i = 0;i<names.length;i++){
        console.log(names[i]);
    }
    console.log(i);
    for(let a of names){
        console.log(a);
    }

</script>
</body>
</html>